## Test that llvm-readobj/llvm-readelf shows proper relocation type
## names and values for mips64 target.

# RUN: yaml2obj %s -o %t-mips64.o
# RUN: llvm-readobj -r --expand-relocs %t-mips64.o | FileCheck %s

# CHECK: Type: R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE (0)
# CHECK: Type: R_MIPS_16/R_MIPS_16/R_MIPS_16 (65793)
# CHECK: Type: R_MIPS_32/R_MIPS_32/R_MIPS_32 (131586)
# CHECK: Type: R_MIPS_REL32/R_MIPS_REL32/R_MIPS_REL32 (197379)
# CHECK: Type: R_MIPS_26/R_MIPS_26/R_MIPS_26 (263172)
# CHECK: Type: R_MIPS_HI16/R_MIPS_HI16/R_MIPS_HI16 (328965)
# CHECK: Type: R_MIPS_LO16/R_MIPS_LO16/R_MIPS_LO16 (394758)
# CHECK: Type: R_MIPS_GPREL16/R_MIPS_GPREL16/R_MIPS_GPREL16 (460551)
# CHECK: Type: R_MIPS_LITERAL/R_MIPS_LITERAL/R_MIPS_LITERAL (526344)
# CHECK: Type: R_MIPS_GOT16/R_MIPS_GOT16/R_MIPS_GOT16 (592137)
# CHECK: Type: R_MIPS_PC16/R_MIPS_PC16/R_MIPS_PC16 (657930)
# CHECK: Type: R_MIPS_CALL16/R_MIPS_CALL16/R_MIPS_CALL16 (723723)
# CHECK: Type: R_MIPS_GPREL32/R_MIPS_GPREL32/R_MIPS_GPREL32 (789516)
# CHECK: Type: R_MIPS_SHIFT5/R_MIPS_SHIFT5/R_MIPS_SHIFT5 (1052688)
# CHECK: Type: R_MIPS_SHIFT6/R_MIPS_SHIFT6/R_MIPS_SHIFT6 (1118481)
# CHECK: Type: R_MIPS_64/R_MIPS_64/R_MIPS_64 (1184274)
# CHECK: Type: R_MIPS_GOT_DISP/R_MIPS_GOT_DISP/R_MIPS_GOT_DISP (1250067)
# CHECK: Type: R_MIPS_GOT_PAGE/R_MIPS_GOT_PAGE/R_MIPS_GOT_PAGE (1315860)
# CHECK: Type: R_MIPS_GOT_OFST/R_MIPS_GOT_OFST/R_MIPS_GOT_OFST (1381653)
# CHECK: Type: R_MIPS_GOT_HI16/R_MIPS_GOT_HI16/R_MIPS_GOT_HI16 (1447446)
# CHECK: Type: R_MIPS_GOT_LO16/R_MIPS_GOT_LO16/R_MIPS_GOT_LO16 (1513239)
# CHECK: Type: R_MIPS_SUB/R_MIPS_SUB/R_MIPS_SUB (1579032)
# CHECK: Type: R_MIPS_INSERT_A/R_MIPS_INSERT_A/R_MIPS_INSERT_A (1644825)
# CHECK: Type: R_MIPS_INSERT_B/R_MIPS_INSERT_B/R_MIPS_INSERT_B (1710618)
# CHECK: Type: R_MIPS_DELETE/R_MIPS_DELETE/R_MIPS_DELETE (1776411)
# CHECK: Type: R_MIPS_HIGHER/R_MIPS_HIGHER/R_MIPS_HIGHER (1842204)
# CHECK: Type: R_MIPS_HIGHEST/R_MIPS_HIGHEST/R_MIPS_HIGHEST (1907997)
# CHECK: Type: R_MIPS_CALL_HI16/R_MIPS_CALL_HI16/R_MIPS_CALL_HI16 (1973790)
# CHECK: Type: R_MIPS_CALL_LO16/R_MIPS_CALL_LO16/R_MIPS_CALL_LO16 (2039583)
# CHECK: Type: R_MIPS_SCN_DISP/R_MIPS_SCN_DISP/R_MIPS_SCN_DISP (2105376)
# CHECK: Type: R_MIPS_REL16/R_MIPS_REL16/R_MIPS_REL16 (2171169)
# CHECK: Type: R_MIPS_ADD_IMMEDIATE/R_MIPS_ADD_IMMEDIATE/R_MIPS_ADD_IMMEDIATE (2236962)
# CHECK: Type: R_MIPS_PJUMP/R_MIPS_PJUMP/R_MIPS_PJUMP (2302755)
# CHECK: Type: R_MIPS_RELGOT/R_MIPS_RELGOT/R_MIPS_RELGOT (2368548)
# CHECK: Type: R_MIPS_JALR/R_MIPS_JALR/R_MIPS_JALR (2434341)
# CHECK: Type: R_MIPS_TLS_DTPMOD32/R_MIPS_TLS_DTPMOD32/R_MIPS_TLS_DTPMOD32 (2500134)
# CHECK: Type: R_MIPS_TLS_DTPREL32/R_MIPS_TLS_DTPREL32/R_MIPS_TLS_DTPREL32 (2565927)
# CHECK: Type: R_MIPS_TLS_DTPMOD64/R_MIPS_TLS_DTPMOD64/R_MIPS_TLS_DTPMOD64 (2631720)
# CHECK: Type: R_MIPS_TLS_DTPREL64/R_MIPS_TLS_DTPREL64/R_MIPS_TLS_DTPREL64 (2697513)
# CHECK: Type: R_MIPS_TLS_GD/R_MIPS_TLS_GD/R_MIPS_TLS_GD (2763306)
# CHECK: Type: R_MIPS_TLS_LDM/R_MIPS_TLS_LDM/R_MIPS_TLS_LDM (2829099)
# CHECK: Type: R_MIPS_TLS_DTPREL_HI16/R_MIPS_TLS_DTPREL_HI16/R_MIPS_TLS_DTPREL_HI16 (2894892)
# CHECK: Type: R_MIPS_TLS_DTPREL_LO16/R_MIPS_TLS_DTPREL_LO16/R_MIPS_TLS_DTPREL_LO16 (2960685)
# CHECK: Type: R_MIPS_TLS_GOTTPREL/R_MIPS_TLS_GOTTPREL/R_MIPS_TLS_GOTTPREL (3026478)
# CHECK: Type: R_MIPS_TLS_TPREL32/R_MIPS_TLS_TPREL32/R_MIPS_TLS_TPREL32 (3092271)
# CHECK: Type: R_MIPS_TLS_TPREL64/R_MIPS_TLS_TPREL64/R_MIPS_TLS_TPREL64 (3158064)
# CHECK: Type: R_MIPS_TLS_TPREL_HI16/R_MIPS_TLS_TPREL_HI16/R_MIPS_TLS_TPREL_HI16 (3223857)
# CHECK: Type: R_MIPS_TLS_TPREL_LO16/R_MIPS_TLS_TPREL_LO16/R_MIPS_TLS_TPREL_LO16 (3289650)
# CHECK: Type: R_MIPS_GLOB_DAT/R_MIPS_GLOB_DAT/R_MIPS_GLOB_DAT (3355443)
# CHECK: Type: R_MIPS_COPY/R_MIPS_COPY/R_MIPS_COPY (8289918)
# CHECK: Type: R_MIPS_JUMP_SLOT/R_MIPS_JUMP_SLOT/R_MIPS_JUMP_SLOT (8355711)
# CHECK: Type: R_MIPS_NUM/R_MIPS_NUM/R_MIPS_NUM (14342874)

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_MIPS
Sections:
  - Name: .rela.text
    Type: SHT_RELA
    Relocations:
      - Type:  R_MIPS_NONE
      - Type:  R_MIPS_16
        Type2: R_MIPS_16
        Type3: R_MIPS_16
      - Type:  R_MIPS_32
        Type2: R_MIPS_32
        Type3: R_MIPS_32
      - Type:  R_MIPS_REL32
        Type2: R_MIPS_REL32
        Type3: R_MIPS_REL32
      - Type:  R_MIPS_26
        Type2: R_MIPS_26
        Type3: R_MIPS_26
      - Type:  R_MIPS_HI16
        Type2: R_MIPS_HI16
        Type3: R_MIPS_HI16
      - Type:  R_MIPS_LO16
        Type2: R_MIPS_LO16
        Type3: R_MIPS_LO16
      - Type:  R_MIPS_GPREL16
        Type2: R_MIPS_GPREL16
        Type3: R_MIPS_GPREL16
      - Type:  R_MIPS_LITERAL
        Type2: R_MIPS_LITERAL
        Type3: R_MIPS_LITERAL
      - Type:  R_MIPS_GOT16
        Type2: R_MIPS_GOT16
        Type3: R_MIPS_GOT16
      - Type:  R_MIPS_PC16
        Type2: R_MIPS_PC16
        Type3: R_MIPS_PC16
      - Type:  R_MIPS_CALL16
        Type2: R_MIPS_CALL16
        Type3: R_MIPS_CALL16
      - Type:  R_MIPS_GPREL32
        Type2: R_MIPS_GPREL32
        Type3: R_MIPS_GPREL32
      - Type:  R_MIPS_SHIFT5
        Type2: R_MIPS_SHIFT5
        Type3: R_MIPS_SHIFT5
      - Type:  R_MIPS_SHIFT6
        Type2: R_MIPS_SHIFT6
        Type3: R_MIPS_SHIFT6
      - Type:  R_MIPS_64
        Type2: R_MIPS_64
        Type3: R_MIPS_64
      - Type:  R_MIPS_GOT_DISP
        Type2: R_MIPS_GOT_DISP
        Type3: R_MIPS_GOT_DISP
      - Type:  R_MIPS_GOT_PAGE
        Type2: R_MIPS_GOT_PAGE
        Type3: R_MIPS_GOT_PAGE
      - Type:  R_MIPS_GOT_OFST
        Type2: R_MIPS_GOT_OFST
        Type3: R_MIPS_GOT_OFST
      - Type:  R_MIPS_GOT_HI16
        Type2: R_MIPS_GOT_HI16
        Type3: R_MIPS_GOT_HI16
      - Type:  R_MIPS_GOT_LO16
        Type2: R_MIPS_GOT_LO16
        Type3: R_MIPS_GOT_LO16
      - Type:  R_MIPS_SUB
        Type2: R_MIPS_SUB
        Type3: R_MIPS_SUB
      - Type:  R_MIPS_INSERT_A
        Type2: R_MIPS_INSERT_A
        Type3: R_MIPS_INSERT_A
      - Type:  R_MIPS_INSERT_B
        Type2: R_MIPS_INSERT_B
        Type3: R_MIPS_INSERT_B
      - Type:  R_MIPS_DELETE
        Type2: R_MIPS_DELETE
        Type3: R_MIPS_DELETE
      - Type:  R_MIPS_HIGHER
        Type2: R_MIPS_HIGHER
        Type3: R_MIPS_HIGHER
      - Type:  R_MIPS_HIGHEST
        Type2: R_MIPS_HIGHEST
        Type3: R_MIPS_HIGHEST
      - Type:  R_MIPS_CALL_HI16
        Type2: R_MIPS_CALL_HI16
        Type3: R_MIPS_CALL_HI16
      - Type:  R_MIPS_CALL_LO16
        Type2: R_MIPS_CALL_LO16
        Type3: R_MIPS_CALL_LO16
      - Type:  R_MIPS_SCN_DISP
        Type2: R_MIPS_SCN_DISP
        Type3: R_MIPS_SCN_DISP
      - Type:  R_MIPS_REL16
        Type2: R_MIPS_REL16
        Type3: R_MIPS_REL16
      - Type:  R_MIPS_ADD_IMMEDIATE
        Type2: R_MIPS_ADD_IMMEDIATE
        Type3: R_MIPS_ADD_IMMEDIATE
      - Type:  R_MIPS_PJUMP
        Type2: R_MIPS_PJUMP
        Type3: R_MIPS_PJUMP
      - Type:  R_MIPS_RELGOT
        Type2: R_MIPS_RELGOT
        Type3: R_MIPS_RELGOT
      - Type:  R_MIPS_JALR
        Type2: R_MIPS_JALR
        Type3: R_MIPS_JALR
      - Type:  R_MIPS_TLS_DTPMOD32
        Type2: R_MIPS_TLS_DTPMOD32
        Type3: R_MIPS_TLS_DTPMOD32
      - Type:  R_MIPS_TLS_DTPREL32
        Type2: R_MIPS_TLS_DTPREL32
        Type3: R_MIPS_TLS_DTPREL32
      - Type:  R_MIPS_TLS_DTPMOD64
        Type2: R_MIPS_TLS_DTPMOD64
        Type3: R_MIPS_TLS_DTPMOD64
      - Type:  R_MIPS_TLS_DTPREL64
        Type2: R_MIPS_TLS_DTPREL64
        Type3: R_MIPS_TLS_DTPREL64
      - Type:  R_MIPS_TLS_GD
        Type2: R_MIPS_TLS_GD
        Type3: R_MIPS_TLS_GD
      - Type:  R_MIPS_TLS_LDM
        Type2: R_MIPS_TLS_LDM
        Type3: R_MIPS_TLS_LDM
      - Type:  R_MIPS_TLS_DTPREL_HI16
        Type2: R_MIPS_TLS_DTPREL_HI16
        Type3: R_MIPS_TLS_DTPREL_HI16
      - Type:  R_MIPS_TLS_DTPREL_LO16
        Type2: R_MIPS_TLS_DTPREL_LO16
        Type3: R_MIPS_TLS_DTPREL_LO16
      - Type:  R_MIPS_TLS_GOTTPREL
        Type2: R_MIPS_TLS_GOTTPREL
        Type3: R_MIPS_TLS_GOTTPREL
      - Type:  R_MIPS_TLS_TPREL32
        Type2: R_MIPS_TLS_TPREL32
        Type3: R_MIPS_TLS_TPREL32
      - Type:  R_MIPS_TLS_TPREL64
        Type2: R_MIPS_TLS_TPREL64
        Type3: R_MIPS_TLS_TPREL64
      - Type:  R_MIPS_TLS_TPREL_HI16
        Type2: R_MIPS_TLS_TPREL_HI16
        Type3: R_MIPS_TLS_TPREL_HI16
      - Type:  R_MIPS_TLS_TPREL_LO16
        Type2: R_MIPS_TLS_TPREL_LO16
        Type3: R_MIPS_TLS_TPREL_LO16
      - Type:  R_MIPS_GLOB_DAT
        Type2: R_MIPS_GLOB_DAT
        Type3: R_MIPS_GLOB_DAT
      - Type:  R_MIPS_COPY
        Type2: R_MIPS_COPY
        Type3: R_MIPS_COPY
      - Type:  R_MIPS_JUMP_SLOT
        Type2: R_MIPS_JUMP_SLOT
        Type3: R_MIPS_JUMP_SLOT
      - Type:  R_MIPS_NUM
        Type2: R_MIPS_NUM
        Type3: R_MIPS_NUM
